<x-layout>

    {{-- 轮播中心 --}}
    @if (!empty($bannerList))
    <div class="index_banner">
        <div class="swiper-wrapper">
            @foreach ($bannerList as $d)
            <div class="swiper-slide">
                <img src="{{$d->image}}" alt="{{$d->title}}">
            </div>
            @endforeach
        </div>
        <div class="swiper-pagination"></div>
        <div class="next"></div>
        <div class="prev"></div>
    </div>
    @endif

    <x-info name="推荐中心" :list="$recommendList"></x-info>

    @foreach ($modules as $module)
    <!-- module: {{$module->name}} -->
    @if ($loop->index % 3 == 0)
    <x-education :name="$module->name" :module="$module" :list="$module->categorys"></x-education>
    @elseif ($loop->index % 3 == 1)
    <x-work :name="$module->name" :module="$module" :list="$module->categorys"></x-work>
    @elseif ($loop->index % 3 == 2)
    <x-talent :name="$module->name" :module="$module" :list="$module"></x-talent>
    @endif
    @endforeach


    <link rel="stylesheet" href="/lib/swiper/swiper.min.css">
    <script src="/lib/swiper/swiper.min.js"></script>
    <script>
        wns.swiperInit(".index_banner", {
            pagination: {
                el: ".index_banner .swiper-pagination",
                clickable: true,
            },
            navigation: {
                nextEl: ".next",
                prevEl: ".prev"
            }
        })
        wns.swiperInit('.index_news_left', {
            pagination: {
                el: ".index_news_left .swiper-pagination",
                clickable: true,
            }
        });
    </script>
</x-layout>
